package com.test.mybatis.test_mybatis.service.impl;

import com.test.mybatis.test_mybatis.entity.simple.Teacher;
import com.test.mybatis.test_mybatis.mapper.simple.TeacherMapper;
import com.test.mybatis.test_mybatis.service.TeacherService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @Author wxb
 * @Datatime 2021/1/14 17:42
 * @Descript
 */
@Service
public class TeacherServiceImpl implements TeacherService {

    @Autowired private TeacherMapper teacherMapper;

    @Override
    public Teacher selectById(Integer id) {
        return teacherMapper.selectDetailById(id);
    }

    @Override
    public List selectTeachers() {
//        return teacherMapper.selectAll();
        return teacherMapper.selectBySubQuery();
    }


    @Override
    public List selectTeachersByParam(String param) {
        return teacherMapper.selectDetailByParam(param);
    }
}
